#include "searcher.hpp"
#include <iostream>
#include<cstring>
#include <string>
#include <cstdio>
const std::string input = "data/raw_html/raw.txt";

int main()
{
    // for test
    ns_searcher::Searcher *search = new ns_searcher::Searcher();
    search->InitSearcher(input);

    std::string query;
    std::string json_string;
    char buff[1024];
    while (true)
    {
        std::cout << "Please Enter You Search Query# ";
        fgets(buff, sizeof(buff) - 1, stdin);
        buff[strlen(buff)-1]=0;
        query=buff;
        search->Search(query,&json_string);
        std::cout<<json_string<<std::endl;
    }
    return 0;
}